package de.tum.in.eist.poll.client.controllers;
import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;

import de.tum.in.eist.poll.shared.beans.Student;

/**
 * UserManagementController
 * @author Sebastian Hofstetter
 *
 */
public class UserManagementController extends Controller {

	/**
	 * adds the amount of students with the prefix "student_" and a random password, which consists of 3 english words
	 * @param count the amount of students to add
	 */
	public void addStudents(int count, AsyncCallback<List<Student>> callback) {
		pollService.newStudents(Controller.controller.getLoggedInUser().getUserID(), "Student_", count, callback);
	}

	/**
	 * gets the list of students of the currently logged in lecturer
	 * @param callback
	 */
	public void getStudents(AsyncCallback<List<Student>> callback) {
		pollService.requestStudents(Controller.controller.getLoggedInUser().getUserID(), callback);
	}

	/**
	 * Removes users from the server database
	 * 
	 * @param usersIDs The IDs belonging to the users
	 * @param callback callback for the server's answer
	 */
	public void removeUsers(String[] userIDs,
			AsyncCallback<String> callback) {
		Controller.controller.pollService.removeUsers(userIDs, callback);
	}
}
